import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;

// 添加WebService注解
@WebService(targetNamespace = "http://localhost:9000/")
public class HelloWorld {
    // 方法添加WebMethod注解
    @WebMethod
    public String sayHelloWorldFrom(String from) {
        String result = "Hello, world, from " + from;
        System.out.println(result);
        return result;
    }
    public static void main(String[] argv) {
        Object implementor = new HelloWorld ();
        // 定义服务端口和路径名
        String address = "http://localhost:9000/HelloWorld";
        // 使用端点发布服务
        Endpoint.publish(address, implementor);
    }
}
